﻿<Controls:SinacorWindow	
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"    
    xmlns:Controls="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient;assembly=Sinacor.Infra.UI.Controls"
    xmlns:Validation="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient.Validation;assembly=Sinacor.Infra.UI.Controls"
    xmlns:Edit="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient.Edit;assembly=Sinacor.Infra.UI.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"    
    mc:Ignorable="d"    
    
    WindowStartupLocation="CenterScreen" 
    WindowState="Maximized" 
    Title="{DynamicResource Bovespa.Contabil.Label.PesquisaCCNomeTela}"
	x:Class="Sinacor.UI.Bovespa.Contabil.View.SmartClient.PesquisaContasContabeis"
    ModulePlus="False"
    ModuleId="BOL">

    <Controls:SinacorExpanderContainer>
        <Grid.RowDefinitions>
            <RowDefinition	Height="95"/>
            <RowDefinition	Height="4"/>
            <RowDefinition	Height="*"
							MinHeight="150"/>
        </Grid.RowDefinitions>
        <Controls:SinacorExpander	Grid.Row="0"
									Header="{DynamicResource Bovespa.Contabil.Label.ExpanderPesquisa}"
									TabIndex="6" IsExpanded="True">
            <Grid>
                <Controls:SinacorLabel	HorizontalAlignment="Left"
                          			    VerticalAlignment="Top"
                          			    Content="{DynamicResource Bovespa.Contabil.Label.PesquisaCCCodResumido}"
                          			    Width="105"
									    Margin="0,0,0,0"/>

                <Controls:SinacorInt32TextBox	Name="txtCodigoResumido"
                                                Width="60"
										        HorizontalAlignment="Left"
										        VerticalAlignment="Top"
										        Margin="109,0,0,0"
										        TabIndex="1" 
                                                Integers="4"
                                                IsFormated="False"
                                                Value="{Binding FiltroPesquisa.CodigoResumido, UpdateSourceTrigger=PropertyChanged}" />

                <Controls:SinacorLabel	HorizontalAlignment="Left"
                          			    VerticalAlignment="Top"
                          			    Content="{DynamicResource Bovespa.Contabil.Label.PesquisaCCNumConta}"
                          			    Width="100"
                          			    Margin="175,0,0,0" />

                <Controls:SinacorTextBox Name="txtNumeroConta"	HorizontalAlignment="Left"
                            			    VerticalAlignment="Top"
                            			    Width="300"
                            			    Margin="280,0,0,0"
										    TabIndex="2"
										    ToolTip="{DynamicResource Bovespa.Contabil.Tooltip.PesquisaCCNumConta}"
                                            MaxLength="50"
                                            Text="{Binding FiltroPesquisa.NumeroConta}" CharacterCasing="Upper" TextAlignment="Left"/>

                <Controls:SinacorLabel	HorizontalAlignment="Left"
									    VerticalAlignment="Top"
									    Content="{DynamicResource Bovespa.Contabil.Label.PesquisaCCNome}"
									    Width="65"
									    Margin="40,25,0,0"/>

                <Controls:SinacorTextBox Name="txtNomeConta"    HorizontalAlignment="Left"
										    Margin="109,25,0,0"
										    VerticalAlignment="Top"
										    Width="720"
										    TabIndex="3"
                                            MaxLength="80"
                                            Text="{Binding FiltroPesquisa.NomeConta}" CharacterCasing="Upper"/>

                <Controls:SinacorButton	HorizontalAlignment="Left"
                                        Name="btnPesquisar"
                           			VerticalAlignment="Top"
                           			Content="{DynamicResource Bovespa.Contabil.Label.BotaoPesquisar}"
                           			Width="85"
                           			Margin="835,25,0,0"
									IsDefault="True"
									ToolTip="{DynamicResource Bovespa.Contabil.Label.BotaoPesquisar}"
									TabIndex="4" Click="btnPesquisar_Click"/>

                <Controls:SinacorButton	HorizontalAlignment="Left"
									    VerticalAlignment="Top"
									    Margin="926,25,0,0"          
									    TabIndex="5"
                                        Name="btnNovaPesquisa"
									    Icon="IconButtonNewSearch"
                                        Click="btnNovaPesquisa_Click"/>

            </Grid>
        </Controls:SinacorExpander>
        <Controls:SinacorExpander	Header="{DynamicResource Bovespa.Contabil.Label.PesquisaCCCodResumido}"
									Grid.Row="2"
									TabIndex="8" IsExpanded="True" AllowExpand="False">
            <Grid>
                <Controls:SinacorDataGrid	TabIndex="7" 
                                            x:Name="dtgContasContabeis"
                                            HorizontalAlignment="Stretch" 
                                            VerticalAlignment="Stretch"
                                            ItemsSource="{Binding ListaContasContabeis}"
                                            AllowDelete="False"
                                            AllowSave="False"
                                            AllowSaveAll="False"
                                            AllowUndo="False"
                                            AllowUndoAll="False"
                                            AllowUndoLast="False" 
                                            ConfirmSelection="dtgContasContabeis_ConfirmSelection">

                    <Controls:SinacorDataGrid.Columns>
                        <Controls:Column Name="CodigoResumido"
                                         Title="Bovespa.Contabil.Label.PesquisaCCCodResumido"
                                         IsRequired="False"
                                         AllowInsert="False"
                                         AllowUpdate="False" 
                                         HorizontalCellAlignment="Right"
										 AutoAdjustWidthToContent="False"
                                         Width="100">
                            <Controls:Column.CellTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <Controls:SinacorLabel Content="{Binding CodigoResumido}"/>
                                        <Controls:SinacorLabel Content="-"/>
                                        <Controls:SinacorLabel Content="{Binding Digito}"/>
                                    </StackPanel>
                                </DataTemplate>
                            </Controls:Column.CellTemplate>
                        </Controls:Column>

                        <Controls:Column Name="Conta"
                                         Title="Bovespa.Contabil.Label.PesquisaCCNumConta"
                                         IsRequired="False"
                                         AllowInsert="False"
                                         AllowUpdate="False" 
                                         HorizontalCellAlignment="Left"
                                         DisplayMemberPath="NumeroConta"
										 AutoAdjustWidthToContent="True"
                                         />

                        <Controls:Column Name="Nome"
                                         Title="Bovespa.Contabil.Label.PesquisaCCNome"
                                         IsRequired="False"
                                         AllowInsert="False"
                                         AllowUpdate="False" 
                                         HorizontalCellAlignment="Left"
                                         DisplayMemberPath="NomeConta"
										 AutoAdjustWidthToContent="False"
                                         Width="400"/>

                    </Controls:SinacorDataGrid.Columns>
                </Controls:SinacorDataGrid>

            </Grid>
        </Controls:SinacorExpander>
    </Controls:SinacorExpanderContainer>
</Controls:SinacorWindow>